'''
Created on July 1, 2022
Tensorflow Implementation of Adaptive Adversarial Contrastive Learning for Cross-Domain Recommendation

@author: Chi-Wei Hsu (apple.iim09g@nycu.edu.tw)
'''
import argparse

def parse_args():
    parser = argparse.ArgumentParser(description="Run ACLCDR.")
    parser.add_argument('--weights_path', nargs='?', default='../', help='Store model path.')
    parser.add_argument('--data_path', nargs='?', default='../Data/', help='Input data path.')
    parser.add_argument('--proj_path', nargs='?', default='./', help='Project path.')
    parser.add_argument('--dataset', nargs='?', default='sport_cloth', help='Choose a dataset')
    parser.add_argument('--pretrain', type=int, default=0,
                        help='0: No pretrain, -1: Pretrain with the learned embeddings, 1:Pretrain with stored models.')
    parser.add_argument('--verbose', type=int, default=1, help='Interval of evaluation.')
    parser.add_argument('--epoch', type=int, default=21, help='Number of epoch.')
    parser.add_argument('--embed_size', type=int, default=16, help='Embedding size.')
    parser.add_argument('--layer_size', nargs='?', default='[16,16]', help='Output sizes of every layer')
    parser.add_argument('--batch_size', type=int, default=1024, help='Batch size.')
    parser.add_argument('--lambda_s',default='0.7')
    parser.add_argument('--lambda_t',default='0.7')
    parser.add_argument('--regs', nargs='?', default='[1e-5]', help='Regularizations.')
    parser.add_argument('--lr', type=float, default=0.001, help='Learning rate.')
    parser.add_argument('--initial_type',  default='x')
    parser.add_argument('--adj_type', nargs='?', default='norm',
                        help='Specify the type of the adjacency (laplacian) matrix from {plain, norm, mean}.')
    parser.add_argument('--alg_type', nargs='?', default='ngcf',
                        help='Specify the type of the graph convolutional layer from {ngcf, gcn, gcmc}.')
    parser.add_argument('--gpu_id', type=int, default=1, help='0 for NAIS_prod, 1 for NAIS_concat')
    parser.add_argument('--node_dropout_flag', type=int, default=0,
                        help='0: Disable node dropout, 1: Activate node dropout')
    parser.add_argument('--node_dropout', nargs='?', default='[0.1]',
                        help='Keep probability w.r.t. node dropout (i.e., 1-dropout_ratio) for each deep layer. 1: no dropout.')
    parser.add_argument('--mess_dropout', nargs='?', default='[0.1,0.1,0.1]',
                        help='Keep probability w.r.t. message dropout (i.e., 1-dropout_ratio) for each deep layer. 1: no dropout.')
    parser.add_argument('--Ks', nargs='?', default='[5, 10]', help='Output sizes of every layer')
    parser.add_argument('--save_flag', type=int, default=0, help='0: Disable model saver, 1: Activate model saver')
    parser.add_argument('--weight_id', type=float, default=0.1, help='0: Disable model saver, 1: Activate model saver')
    parser.add_argument('--test_flag', nargs='?', default='part',
                        help='Specify the test type from {part, full}, indicating whether the reference is done in mini-batch')
    parser.add_argument('--report', type=int, default=0,
                        help='0: Disable performance report w.r.t. sparsity levels, 1: Show performance report w.r.t. sparsity levels')
    parser.add_argument('--weight_loss',nargs='?', default='[1.,1.]')
    parser.add_argument('--n_interaction',type=int, default=3)
    parser.add_argument('--neg_num',type=int, default=4)
    parser.add_argument('--connect_type',type=str, default='concat', help='concat or mean')
    parser.add_argument('--layer_fun',type=str, default='gcf', help='feature propagation way (GCN, NGCF, LightGCN, GCF)')
    parser.add_argument('--sparcy_flag',type=int, default=0)

    parser.add_argument('--user_ratio', type=float, default=0.3, help='decide the number of user for augmentation, e.g. 0.1,0.3,0.5,0.7,0.9')
    parser.add_argument('--item_ratio', type=float, default=0.3, help='decide the number of item for augmentation, e.g. 0.1,0.3,0.5,0.7,0.9')

    parser.add_argument('--aug_type', type=int, default=0, help='0: Node Dropout; 1: Edge Dropout; 2: Random Walk')
    parser.add_argument('--cl_type', type=int, default=0, help='0: DDQN; 1: Random; 2: Interaction; 3: Rating')
    parser.add_argument('--cl_reg', type=float, default=0.5, help='self-supervised learning regularization term')
    parser.add_argument('--cl_temp', type=float, default=0.5, help='contrastive learning params')
    parser.add_argument('--cl_ratio', type=float, default=10e-5, help='10e-7, 10e-6, 10e-5, 10e-4, 10e-3, 10e-2, 10e-1')
    parser.add_argument('--cl_mode', nargs='?', default='all_level', help='user_level, item_level, all_level')
    parser.add_argument('--r_weights_s', type=float, default=0.5, help='decide the weight of reward across domains')

    return parser.parse_args()
